/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testes;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;

/**
 * @author root
 */
public class FileTests {

    public static void main(String[] args) {
        File[] a = new File("/tmp").listFiles();




        Collection<File> all = new ArrayList<>();
        addTree(new File("."), all);
        System.out.println(all);
    }

    static void addTree(File file, Collection<File> all) {
        File[] children = file.listFiles();
        if (children != null) {
            for (File child : children) {
                all.add(child);
                addTree(child, all);
            }
        }
    }
}
